﻿// <copyright file="RepeatedSwitchTelegram.cs" company="Hallvard Korsgaard">
//  Microsoft Public License (Ms-PL). See license details here: http://enoceannet.codeplex.com/license
// </copyright>
// <author>Hallvard Korsgaard</author> 

namespace EnOcean.Radio.Sensor
{
  using System;

  /// <summary>
  /// Telegram from a switch module (ORG = 0x05).
  /// </summary>
  [Serializable]
  public abstract class RepeatedSwitchTelegram : SensorTelegram
  {
    /// <summary>
    /// Gets or sets the switch type.
    /// </summary>
    public SwitchType SwitchType
    {
      get;
      set;
    }

    /// <summary>
    /// Gets or sets a value indicating whether the energy bow was pressed.
    /// </summary>
    public bool IsEnergyBowPressed
    {
      get;
      set;
    }

    /// <summary>
    /// Creates the byte format of the message.
    /// </summary>
    /// <param name="message">A byte array of length 14 to hold the message contents.</param>
    protected internal override void CreateMessage(byte[] message)
    {
      base.CreateMessage(message);
      message[3] = (byte)Org.RepeatedSwitch;
    }
  }
}
